﻿CREATE TABLE [dbo].[Challenge](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UniqueID] [varchar](27) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Author] [nvarchar](50) NOT NULL,
	[Environment] [nvarchar](20) NOT NULL,
	[Races] [int] NOT NULL,
	[Created] [datetime] NOT NULL,
	[LastChanged] [datetime] NULL,
 CONSTRAINT [PK_Challenge] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Challenge] ADD  CONSTRAINT [DF_Challenge_Created]  DEFAULT (getdate()) FOR [Created]
GO

CREATE NONCLUSTERED INDEX [IX_UniqueID] ON [dbo].[Challenge] 
(
	[UniqueID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO

CREATE UNIQUE NONCLUSTERED INDEX [IX_Unique_UID] ON [dbo].[Challenge] 
(
	[UniqueID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO